package Models;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import utils.Calcs;

public class Brew {
    private final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy", Locale.US);
    
    private int brewID;
    private BrewNote brewNoteID1;
    private BrewNote brewNoteID2;
    private BrewNote brewNoteID3;
    private BrewNote brewNoteID4;
    private BrewNote brewNoteID5;
    private BrewNote brewNoteID6;
    private int state;
    private Date brewDate;
    private FermentationFive secondaryFermentationNotes = new FermentationFive();
    private double terminalGravity;
    private Date conditioningDate;
    private Date conditioningTime;
    private double brewPSI;
    private double conditioningTemp;
    private Date packagingDate;
    private Date packagingTime;
    private double volumeLeft;
    private double secondaryFermentationVolume;
    private double conditioningFermentationVolume;
    private int primaryVesselID;
    private int secondaryVesselID;
    private int conditioningVesselID;
    private int ganttColor;
    private Date ganttStart;
    private Date ganttSecond;
    private Date ganttCond;
    private Date ganttStop;
    private int ganttPrimaryID;
    private int ganttSecondaryID;
    private int ganttConditioningID;
    private String ganttFGICSV;
    private boolean ganttFilter;
    private boolean ganttHarvest;
    private Date ganttHarvestDate;
    private boolean ganttFine;
    private int version;
    private int origBrew;
    private BeerView beer;
    private Recipe recipe;
    private List<DryHopNotes> dryHopNotes;
    private List<FermentationNotes> fermNotes;
    private List<PitchNotes> pitchNotes;
    
	public int getBrewID() {
		return brewID;
	}
	public void setBrewID(int brewID) {
		this.brewID = brewID;
	}
	public BrewNote getBrewNoteID1() {
		return brewNoteID1;
	}
	public void setBrewNoteID1(BrewNote brewNoteID1) {
		this.brewNoteID1 = brewNoteID1;
	}
	public BrewNote getBrewNoteID2() {
		return brewNoteID2;
	}
	public void setBrewNoteID2(BrewNote brewNoteID2) {
		this.brewNoteID2 = brewNoteID2;
	}
	public BrewNote getBrewNoteID3() {
		return brewNoteID3;
	}
	public void setBrewNoteID3(BrewNote brewNoteID3) {
		this.brewNoteID3 = brewNoteID3;
	}
	public BrewNote getBrewNoteID4() {
		return brewNoteID4;
	}
	public void setBrewNoteID4(BrewNote brewNoteID4) {
		this.brewNoteID4 = brewNoteID4;
	}
	public BrewNote getBrewNoteID5() {
		return brewNoteID5;
	}
	public void setBrewNoteID5(BrewNote brewNoteID5) {
		this.brewNoteID5 = brewNoteID5;
	}
	public BrewNote getBrewNoteID6() {
		return brewNoteID6;
	}
	public void setBrewNoteID6(BrewNote brewNoteID6) {
		this.brewNoteID6 = brewNoteID6;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public Date getBrewDate() {
		return brewDate;
	}
	public void setBrewDate(Date brewDate) {
		this.brewDate = brewDate;
	}
    public void setSecondaryFermentationNotesTemp(final double temp){
        this.secondaryFermentationNotes.setFermentationTemp(temp);
    }
    public double getSecondaryFermentationNotesTemp(){
        return this.secondaryFermentationNotes.getFermentationTemp();
    }
    public void setSecondaryFermentationNotesGrav(final double grav){
        this.secondaryFermentationNotes.setFermentationGravity(grav);
    }
    public double getSecondaryFermentationNotesGrav(){
        return this.secondaryFermentationNotes.getFermentationGravity();
    }
    public void setSecondaryFermentationNotesDate(final Date date){
        this.secondaryFermentationNotes.setDate(date);
    }
    public Date getSecondaryFermentationNotesDate(){
        return this.secondaryFermentationNotes.getFermentationDate();
    }
    public void setSecondaryFermentationNotesTime(final Date time){
        this.secondaryFermentationNotes.setFermentationTime(time);
    }
    public Date getSecondaryFermentationNotesTime(){
        return this.secondaryFermentationNotes.getFermentationTime();
    }
    public void setSecondaryFermentationNotesNote(final String notes){
        this.secondaryFermentationNotes.setFermentationNotes(notes);
    }
    public String getSecondaryFermentationNotesNote(){
        return this.secondaryFermentationNotes.getFermentationNotes();
    }
	public FermentationFive getSecondaryFermentationNotes() {
		return secondaryFermentationNotes;
	}
	public void setSecondaryFermentationNotes(
			FermentationFive secondaryFermentationNotes) {
		this.secondaryFermentationNotes = secondaryFermentationNotes;
	}
	public double getTerminalGravity() {
		return terminalGravity;
	}
	public void setTerminalGravity(final double terminalGravity) {
		if((terminalGravity < 1.200)&&(terminalGravity != 0)){
            this.terminalGravity = Calcs.specificGravityToPlato(terminalGravity);
        } else {
            this.terminalGravity = terminalGravity;
        }
	}
	public Date getConditioningDate() {
		return conditioningDate;
	}
	public void setConditioningDate(Date conditioningDate) {
		this.conditioningDate = conditioningDate;
	}
	public Date getConditioningTime() {
		return conditioningTime;
	}
	public void setConditioningTime(Date conditioningTime) {
		this.conditioningTime = conditioningTime;
	}
	public double getBrewPSI() {
		return brewPSI;
	}
	public void setBrewPSI(double brewPSI) {
		this.brewPSI = brewPSI;
	}
	public double getConditioningTemp() {
		return conditioningTemp;
	}
	public void setConditioningTemp(double conditioningTemp) {
		this.conditioningTemp = conditioningTemp;
	}
	public Date getPackagingDate() {
		return packagingDate;
	}
	public void setPackagingDate(Date packagingDate) {
		this.packagingDate = packagingDate;
	}
	public Date getPackagingTime() {
		return packagingTime;
	}
	public void setPackagingTime(Date packagingTime) {
		this.packagingTime = packagingTime;
	}
	public double getVolumeLeft() {
		return volumeLeft;
	}
	public void setVolumeLeft(double volumeLeft) {
		this.volumeLeft = volumeLeft;
	}
	public double getSecondaryFermentationVolume() {
		return secondaryFermentationVolume;
	}
	public void setSecondaryFermentationVolume(double secondaryFermentationVolume) {
		this.secondaryFermentationVolume = secondaryFermentationVolume;
	}
	public double getConditioningFermentationVolume() {
		return conditioningFermentationVolume;
	}
	public void setConditioningFermentationVolume(
			double conditioningFermentationVolume) {
		this.conditioningFermentationVolume = conditioningFermentationVolume;
	}
	public int getPrimaryVesselID() {
		return primaryVesselID;
	}
	public void setPrimaryVesselID(int primaryVesselID) {
		this.primaryVesselID = primaryVesselID;
	}
	public int getSecondaryVesselID() {
		return secondaryVesselID;
	}
	public void setSecondaryVesselID(int secondaryVesselID) {
		this.secondaryVesselID = secondaryVesselID;
	}
	public int getConditioningVesselID() {
		return conditioningVesselID;
	}
	public void setConditioningVesselID(int conditioningVesselID) {
		this.conditioningVesselID = conditioningVesselID;
	}
	public int getGanttColor() {
		return ganttColor;
	}
	public void setGanttColor(int ganttColor) {
		this.ganttColor = ganttColor;
	}
	public Date getGanttStart() {
		return ganttStart;
	}
	public void setGanttStart(Date ganttStart) {
		this.ganttStart = ganttStart;
	}
	public Date getGanttSecond() {
		return ganttSecond;
	}
	public void setGanttSecond(Date ganttSecond) {
		this.ganttSecond = ganttSecond;
	}
	public Date getGanttCond() {
		return ganttCond;
	}
	public void setGanttCond(Date ganttCond) {
		this.ganttCond = ganttCond;
	}
	public Date getGanttStop() {
		return ganttStop;
	}
	public void setGanttStop(Date ganttStop) {
		this.ganttStop = ganttStop;
	}
	public int getGanttPrimaryID() {
		return ganttPrimaryID;
	}
	public void setGanttPrimaryID(int ganttPrimaryID) {
		this.ganttPrimaryID = ganttPrimaryID;
	}
	public int getGanttSecondaryID() {
		return ganttSecondaryID;
	}
	public void setGanttSecondaryID(int ganttSecondaryID) {
		this.ganttSecondaryID = ganttSecondaryID;
	}
	public int getGanttConditioningID() {
		return ganttConditioningID;
	}
	public void setGanttConditioningID(int ganttConditioningID) {
		this.ganttConditioningID = ganttConditioningID;
	}
	public String getGanttFGICSV() {
		return ganttFGICSV;
	}
	public void setGanttFGICSV(String ganttFGICSV) {
		this.ganttFGICSV = ganttFGICSV;
	}
	public boolean isGanttFilter() {
		return ganttFilter;
	}
	public void setGanttFilter(boolean ganttFilter) {
		this.ganttFilter = ganttFilter;
	}
	public boolean isGanttHarvest() {
		return ganttHarvest;
	}
	public void setGanttHarvest(boolean ganttHarvest) {
		this.ganttHarvest = ganttHarvest;
	}
	public Date getGanttHarvestDate() {
		return ganttHarvestDate;
	}
	public void setGanttHarvestDate(Date ganttHarvestDate) {
		this.ganttHarvestDate = ganttHarvestDate;
	}
	public boolean isGanttFine() {
		return ganttFine;
	}
	public void setGanttFine(boolean ganttFine) {
		this.ganttFine = ganttFine;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public int getOrigBrew() {
		return origBrew;
	}
	public void setOrigBrew(int origBrew) {
		this.origBrew = origBrew;
	}
	public BeerView getBeer() {
		return beer;
	}
	public void setBeer(BeerView beer) {
		this.beer = beer;
	}
	public Recipe getRecipe() {
		return recipe;
	}
	public void setRecipe(Recipe recipe) {
		this.recipe = recipe;
	}
	public List<DryHopNotes> getDryHopNotes() {
		return dryHopNotes;
	}
	public void setDryHopNotes(List<DryHopNotes> dryHopNotes) {
		this.dryHopNotes = dryHopNotes;
	}
	public List<FermentationNotes> getFermNotes() {
		return fermNotes;
	}
	public void setFermNotes(List<FermentationNotes> fermNotes) {
		this.fermNotes = fermNotes;
	}
	public List<PitchNotes> getPitchNotes() {
		return pitchNotes;
	}
	public void setPitchNotes(List<PitchNotes> pitchNotes) {
		this.pitchNotes = pitchNotes;
	}
    
    public String getDisplayString(){
        return Integer.toString(this.brewID)
                + " - " + dateFormat.format(this.brewDate)
                + " - " + this.beer.getBeerName();
    }
    public String getSmallDisplay(){
        return Integer.toString(this.brewID)
                + " - " + this.beer.getBeerName();
    }
}
